import http from '@/utils/request'
import { base } from '@/config'
const baseUrl = base.user + '/integralConfig'

// 积分选项模块
const integralConfig = {
  // 新增积分选项
  add: data => {
    return http.postJson(`${baseUrl}/add`, data)
  },

  // 编辑积分选项
  edit: data => {
    return http.postJson(`${baseUrl}/edit`, data)
  },

  // 编辑积分选项是否开启
  isOpen: data => {
    return http.postJson(`${baseUrl}/edit/isOpen`, data)
  },

  // 积分选项列表
  list: params => {
    return http.get(`${baseUrl}/list`, params)
  },

  // 不分页积分选项列表
  selectList: () => {
    return http.get(`${baseUrl}/selectList`)
  },

  // 获取积分选择详情
  detail: id => {
    return http.get(`${baseUrl}/${id}`)
  }
}

export default integralConfig
